<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>天天生鲜-用户中心</title>
	<link rel="stylesheet" type="text/css" href="/static/css/reset.css">
	<link rel="stylesheet" type="text/css" href="/static/css/main.css">
</head>
<body>
	{% include 'header.html' %}

	{% include 'search.html' %}

	<div class="main_con clearfix">
		<div class="left_menu_con clearfix">
			<h3>用户中心</h3>
			<ul>
				<li><a href="/user_center_info" >· 个人信息</a></li>
				<li><a href="/user_center_order" >· 全部订单</a></li>
				<li><a href="/user_center_site" class="active">· 收货地址</a></li>
			</ul>
		</div>

		<div class="right_content clearfix">
				<h3 class="common_title2">收货地址</h3>
				<div class="site_con">
					<dl>
						{% if address %}
						<dt>当前地址：</dt>
						<dd>{{address.address}} ({{address.user_name}} 收) {{address.phone}}</dd>
						{% else %}
						   <dt>未设置收货地址：</dt>
						{% endif %}
					</dl>					
				</div>
				<h3 class="common_title2">编辑地址</h3>
				<div class="site_con">
					<form action="/user_center_site/" method="post" id="address_form">
						{% csrf_token %}
						<div class="form_group">
							<label>收件人：</label>
							<input type="text" name="user_name" value="{{address.user_name}}">
						</div>
						<div class="form_group form_group2">
							<label>详细地址：</label>
							<textarea class="site_area" name="address">{{address.address}}</textarea>
						</div>
						<!--<div class="form_group">
							<label>邮编：</label>
							<input type="text" name="">
						</div>-->
						<div class="form_group">
							<label>手机：</label>
							<input type="text" name="phone" value="{{address.phone}}">
						</div>

						<input type="submit" id="add_address" name="" value="提交" class="info_submit">
					</form>
				</div>
		</div>
	</div>

<!--	<script type="text/javascript" src="/static/js/jquery-1.12.4.min.js"></script>-->
<!--	<script type="text/javascript">-->
<!--		$('#add_address').bind('click',function(event){-->
<!--		  $.ajax({-->
<!--			type:"POST",-->
<!--			url:"/user_center_site/",-->
<!--			data:$('#address_form').serialize(),//序列化表单值-->
<!--			async:false,-->
<!--			error:function(request){-->
<!--			  alert("程序出错，请联系管理员");-->
<!--			},-->
<!--			success:function(data){-->
<!--				if(data.status!=0){-->
<!--				alert("收货地址设置成功!");-->
<!--				}else{-->
<!--				alert(data.msg);-->
<!--				  }-->
<!--			  }-->
<!--			});-->
<!--		});-->
<!--	</script>-->
	{% include 'footer.html' %}
	
</body>
</html>